<?php


class birth {

	function birth_month(&$bean, $event, $arguments) 
	{
		$bday=$bean->birthdate;
		$id=$bean->id;
		$bday2= explode("-",$bday);
		$bdaycw1=$bday2[2]."/".$bday2[1]."/".$bday2[0];
		$bdm=$bday2[1];//month of original birthdate
		$bdt=$bday2[2];//date of original birthdate
		$date_birth=$bdm."/".$bdt;//merge date and month
		$dd=strtotime($date_birth);//convert string to time
		$ddd=date('d/m/Y',$dd);// assign SQL format
		$dddabc=date('Y/m/d',$dd);
		
		$updateforbirthdate = ("UPDATE contacts_cstm SET birthday_search_c = '".$dddabc."' WHERE id_c = '".$id."'");
        $bean->db->query($updateforbirthdate, true, "Error updating Accounts - last touched:");
	}

}

?>
